%%%%%%%%%%%%%%%%%%
% PROTOTYPE FILE %
%%%%%%%%%%%%%%%%%%

% function prototype
function prototype(states,vector_size,target_kind)

% write individual syllables for each call example to file
fid=fopen('proto','w');

mean_value=0.0;
variance_value=1.0;
mean_values=repmat(mean_value,1,vector_size);
variance_values=repmat(variance_value,1,vector_size);

fprintf(fid,'~o <VecSize> %d ',vector_size);
fprintf(fid,'<%s>\n',target_kind);
fprintf(fid,'~h "proto"\n');
fprintf(fid,'<BeginHMM>\n');
fprintf(fid,'   <NumStates> %d\n',states);

for i=2:states-1
    fprintf(fid,'   <State> %d\n',i);
    fprintf(fid,'       <Mean> %d\n',vector_size);
    fprintf(fid,'       %5.1f',mean_values);
    fprintf(fid,'       \n<Variance> %d\n',vector_size);
    fprintf(fid,'       %5.1f',variance_values);
    fprintf(fid,'\n');
end


if states==1
    transition_matrix=1;
else
    transition_matrix=zeros(states,states);
    transition_matrix(1,2)=1.0;
    transition_matrix(states-1,states-1)=0.7;
    transition_matrix(states-1,states)=0.3;
end
     

j=1;
for i=2:states-2
    j=j+1;
    transition_matrix(i,j)=0.6;
    transition_matrix(i,j+1)=0.4;
end

fprintf(fid,'   <TransP> %d\n',states);

for i=1:states
    for j=1:states
        fprintf(fid,'%5.1f',transition_matrix(i,j));
    end
    fprintf(fid,'\n');
end

fprintf(fid,'<EndHMM>\n');

status=fclose(fid);


